import './sliseshow.css'
import {getBanner} from '../../tools/Ajax' 
import { useEffect, useState } from 'react'
import { Carousel } from 'antd';

// 轮播
const contentStyle = {
    height: '500px',
    color: '#fff',
    // lineHeight: '160px',
    textAlign: 'center',
    background: '#364d79',
    borderRadius: '20px',
  };

function Slideshow(){
    let [arr,setArr] = useState([])
    const [auto,setAuto] = useState(true)
    useEffect(() =>{
        getBanner().then(res=>{
            setArr(res.data.data)
            console.log(3,res.data.data);
        })
    },[])
    return <div className='slid'>
        <div className='box'>
        <Carousel autoplay  >
            {
                arr.map((item,i) =>{
                    return (
                        <div className='imgs' key={i}>
                            <img style={contentStyle} src={item} alt=""/>
                        </div>
                        
                    )
                })
            }
        </Carousel>

        </div>

    </div>
}
export default Slideshow